package com.ffsky.template.demo.app;

import android.view.View;

import com.ffsky.template.demo.databinding.ActivityWaveBinding;
import com.ffsky.template.demo.databinding.ActivityWaveLayoutBinding;
import com.gitee.hljdrl.ffkit.app.FFKitActivity;

public class WaveLayoutActivity extends FFKitActivity {

    ActivityWaveLayoutBinding binding;

    @Override
    public View getBindingView() {
        binding = ActivityWaveLayoutBinding.inflate(getLayoutInflater());
        return binding.getRoot();
    }

    @Override
    public void initView() {
        binding.waveLayout1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (binding.waveLayout1.isRunning()) {
                    binding.waveLayout1.stopAnimation();
                    binding.btnVoice.setText("开始");
                } else {
                    binding.waveLayout1.startAnimation();
                    binding.btnVoice.setText("停止");
                }
            }
        });

        binding.waveLayout2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (binding.waveLayout2.isRunning()) {
                    binding.waveLayout2.stopAnimation();
                    binding.btnVoice2.setText("开始");
                } else {
                    binding.waveLayout2.startAnimation();
                    binding.btnVoice2.setText("停止");
                }
            }
        });

    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }
}
